import java.util.Scanner;
public class yuan {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请选择计算圆面积(1)还是矩形面积(2):");
        int c = sc.nextInt();
        if (c == 1) {
            System.out.println("请输入圆的半径:");
            int r = sc.nextInt();
            System.out.println("该圆面积:" + printArea(r));
        }
        else if (c == 2){
            System.out.println("请输入矩形的长:");
            int d =sc.nextInt();
            System.out.println("请输入矩形的高:");
            int e =sc.nextInt();
            System.out.println("矩形的面积为:" +printArea(d,e));
        }
        else {
            System.out.println("输入错误,请重新输入");
        }
        }
        public static double printArea(int i) {
        return 3.14*i*i;
        }
        public static double printArea(int a,int b) {
        return a*b;
        }
    }
